from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from . import views


urlpatterns = [
    # 跳转首页
    # url(r'^books/$', views.BooksAPIView.as_view()),
    # url(r'^books/(?P<pk>\d+)/$', views.BookAPIView.as_view()),
    #
    # url(r'^heros/$', views.HerosView.as_view()),
    # url(r'^heros/(?P<pk>\d+)/$', views.HeroView.as_view()),
    url(r'^bookss/$', views.BooksGenericAPIView.as_view()),
    url(r'^bookss/(?P<pk>\d+)/$', views.BookssGenericAPIView.as_view()),
]
#必须结合视图集使用
router = DefaultRouter()
router.register("books",views.BooksViewSet,base_name="books")
urlpatterns += router.urls
